﻿
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
namespace SWBetongXaydung.DAL
{
    public partial class BETONGXAYDUNGEntities : DbContext
    {
        static BETONGXAYDUNGEntities()
        {
            Database.SetInitializer<BETONGXAYDUNGEntities>(null);
            //Database.SetInitializer(new DropCreateDatabaseIfModelChanges<QLNHD_KHContext>());
            //Database.SetInitializer(new MyInitializer());
        }
        public BETONGXAYDUNGEntities()
            : base("name=BETONGXAYDUNGEntities")
        {
        }
        public BETONGXAYDUNGEntities(string connectionString)
            : base(connectionString)
        {

        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            //throw new UnintentionalCodeFirstException();
            modelBuilder.Entity<QuyetToan>().HasKey(e => new { e.IDTaiXe, e.SoXe, e.Thang, e.Nam });
        }

        public DbSet<DieuXe> DieuXeDbSet { get; set; }
        public DbSet<DinhMucNhienLieu> DinhMucNhienLieuDbSet { get; set; }
        public DbSet<DonGiaNhienLieu> DonGiaNhienLieuDbSet { get; set; }
        public DbSet<HanhTrinh> HanhTrinhDbSet { get; set; }
        public DbSet<LoaiNhienLieu> LoaiNhienLieuDbSet { get; set; }
        public DbSet<LoaiXe> LoaiXeDbSet { get; set; }
        public DbSet<NguoiSuDung> NguoiSuDungDbSet { get; set; }
        public DbSet<NhanNhienLieu> NhanNhienLieuDbSet { get; set; }
        public DbSet<PhanCongLaiXe> PhanCongLaiXeDbSet { get; set; }
        public DbSet<TramCapBeTong> TramCapBeTongDbSet { get; set; }
        public DbSet<Xe> XeDbSet { get; set; }
        public DbSet<QuyetToan> QuyetToanDbSet { get; set; }
        public DbSet<TaiXe> TaiXeDbSet { get; set; }
    }

}
